#include <iostream>

#include "Definitions.h"

#include "Scanner.h"
#include "ListingGenerator.h"
#include "RecursiveDescentParser.h"

using namespace std;

int main(int argc, char** argv) {
	if(argc < 2) {
		cout << APP_FILENAME << ": no input file" << endl;
		return 0;
	} else {
		string options(argv[1]);
		if(options == "-v") {
			cout << "Alex's MinC Compiler (c) 2007\nVersion " <<
				APP_VERSION_MAJOR << "." << APP_VERSION_MINOR << endl;
			return 0;
		}
	} 

	Scanner sc(argv[1]);
	ListingGenerator lg(&sc);
	RecursiveDescentParser rdp(&sc);
	
	rdp.registerObserver(&lg);
	rdp.start();
	
	return 0;	
}
